<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE">
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
    <title>我的订单</title>
    <link rel="icon" href="./img/favicon.ico">
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <link rel="stylesheet" type="text/css" href="./css/all.css"/>
    <link rel="stylesheet" type="text/css" href="./css/pages-seckillOrder.css"/>
</head>

<body>
<div id="app">
    <!-- 头部栏位 -->
    <!--页面顶部-->
    <div id="nav-bottom">

        <!--顶部-->
        <div class="nav-top">
            <div class="top">
                <div class="py-container">
                    <div class="shortcut">
                        <ul class="fl">
                            <li class="f-item">青橙欢迎您！</li>
                            <span v-if="username==''">
									请 <a href="login.html">登录</a>
								</span>
                            <span v-if="username!=''">
								{{username}}
								<a href="/logout/cas">退出登录</a>
								</span>
                        </ul>
                        <div class="fr typelist">
                            <ul class="types">
                                <span><a href="center-index.html">我的订单</a></span>

                                <li class="f-item"><span><a href="cart.html" target="_blank">我的购物车</a></span></li>
                                <li class="f-item"><span><a href="home.html" target="_blank">我的青橙</a></span></li>
                                <li class="f-item"><span>青橙会员</span></li>
                                <li class="f-item"><span>企业采购</span></li>
                                <li class="f-item"><span>关注青橙</span></li>
                                <li class="f-item"><span><a href="cooperation.html" target="_blank">合作招商</a></span></li>
                                <li class="f-item"><span><a href="shoplogin.html" target="_blank">商家后台</a></span></li>
                                <li class="f-item"><span>网站导航</span></li>
                            </ul>
                        </div>

                    </div>
                </div>
            </div>

            <!--头部-->
            <div class="header">
                <div class="py-container">
                    <div class="yui3-g Logo">
                        <div class="yui3-u Left logoArea">
                            <a class="logo-bd" title="青橙" href="index.do" target="_blank"></a>
                        </div>
                        <div class="yui3-u Rit searchArea">
                            <div class="search">
                                <form action="" class="sui-form form-inline">
                                    <!--searchAutoComplete-->
                                    <div class="input-append">
                                        <input type="text" id="autocomplete" class="input-error input-xxlarge"/>
                                        <button class="sui-btn btn-xlarge btn-danger" type="button">搜索</button>
                                    </div>
                                </form>
                            </div>
                        </div>

                    </div>

                </div>
            </div>
        </div>
    </div>

    <!--header-->
    <div id="account">
        <div class="py-container">
            <div class="yui3-g home">
                <!--左侧列表-->
                <div class="yui3-u-1-6 list">

                    <div class="person-info">
                        <div class="person-photo"><img src="./img/_/photo.png" alt=""></div>
                        <div class="person-account">
                            <span class="name">Michelle</span>
                            <span class="safe">账户安全</span>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                    <div class="list-items">
                        <dl>
                            <dt><i>·</i> 订单中心</dt>
                            <dd><a href="center-index1.html" class="list-active">我的订单</a></dd>
                            <dd><a href="center-order-pay.html">待付款</a></dd>
                            <dd><a href="center-order-send.html">待发货</a></dd>
                            <dd><a href="center-order-receive.html">待收货</a></dd>
                            <dd><a href="center-order-evaluate.html">待评价</a></dd>
                        </dl>
                        <dl>
                            <dt><i>·</i> 我的中心</dt>
                            <dd><a href="center-collect.html">我的收藏</a></dd>
                            <dd><a href="center-footmark.html">我的足迹</a></dd>
                        </dl>
                        <dl>
                            <dt><i>·</i> 物流消息</dt>
                        </dl>
                        <dl>
                            <dt><i>·</i> 设置</dt>
                            <dd><a href="center-setting-info.html">个人信息</a></dd>
                            <dd><a href="center-setting-address.html">地址管理</a></dd>
                            <dd><a href="center-setting-safe.html">安全管理</a></dd>
                        </dl>
                    </div>
                </div>
                <!--右侧主内容-->
                <div class="yui3-u-5-6 order-pay">
                    <div class="body">
                        <div class="table-title">
                            <table class="sui-table  order-table">
                                <tr>
                                    <thead>
                                    <th width="35%">宝贝</th>
                                    <th width="5%">单价</th>
                                    <th width="5%">数量</th>
                                    <th width="8%">商品操作</th>
                                    <th width="10%">实付款</th>
                                    <th width="10%">交易状态</th>
                                    <th width="10%">交易操作</th>
                                    </thead>
                                </tr>
                            </table>
                        </div>
                        <div class="order-detail">
                            <div class="orders">
                                <div class="choose-order">
                                    <div class="sui-pagination pagination-large top-pages">
                                        <ul>
                                            <li class="prev disabled"><a href="#">上一页</a></li>

                                            <li class="next"><a href="#">下一页</a></li>
                                        </ul>
                                    </div>
                                </div>
                                <div v-for="row in rows">
                                    <!--order1-->
                                    <div class="choose-title">
                                        <label data-toggle="checkbox" class="checkbox-pretty ">
                                            <input type="checkbox" checked="checked"><span>{{row.order.createTime}}　订单编号：{{row.order.id}}  <a>和我联系</a></span>
                                        </label>
                                        <a class="sui-btn btn-info share-btn">分享</a>
                                    </div>
                                    <table class="sui-table table-bordered order-datatable">
                                        <tbody>
                                        <tr v-for="orderItem,index in row.orderItemList">
                                            <td width="35%">
                                                <div class="typographic"><img :src="orderItem.image" width="82"
                                                                              height="82"/>
                                                    <a href="#" class="block-text">{{orderItem.name}}</a>
                                                    <!--<span class="guige">规格：</span>-->
                                                </div>
                                            </td>
                                            <td width="5%" class="center">
                                                <ul class="unstyled">
                                                    <li class="o-price">¥{{(orderItem.money/100).toFixed(2)}}</li>
                                                    <li>¥{{(orderItem.payMoney/100).toFixed(2)}}</li>
                                                </ul>
                                            </td>
                                            <td width="5%" class="center">{{orderItem.num}}</td>

                                            <td width="8%" class="center" :rowspan="row.orderItemList.length"
                                                v-if="row.order.orderStatus=='0'&&index==0">
                                            </td>
                                            <td width="8%" class="center" :rowspan="row.orderItemList.length"
                                                v-if="row.order.orderStatus=='1'&&index==0">
                                                <ul class="unstyled">
                                                    <li>未发货</li>
                                                    <li><a>退货/退款</a></li>
                                                </ul>
                                            </td>
                                            <td width="8%" class="center" :rowspan="row.orderItemList.length"
                                                v-if="row.order.orderStatus=='2'&&index==0">
                                                <ul class="unstyled">
                                                    <li>已发货</li>
                                                    <li><a>退货/退款</a></li>
                                                </ul>
                                            </td>
                                            <td width="8%" class="center" :rowspan="row.orderItemList.length"
                                                v-if="row.order.orderStatus=='3'&&index==0">
                                                <ul class="unstyled">
                                                    <li>订单完成</li>
                                                    <li><a>退货/退款</a></li>
                                                </ul>
                                            </td>
                                            <td width="8%" class="center" :rowspan="row.orderItemList.length"
                                                v-if="row.order.orderStatus=='4'&&index==0">
                                            </td>
                                            <td width="10%" class="center" :rowspan="row.orderItemList.length"
                                                v-if="index==0">
                                                <ul class="unstyled">
                                                    <li>¥{{(row.order.payMoney/100).toFixed(2)}}</li>
                                                    <li>（含运费：￥{{(row.order.postFee/100).toFixed(2)}}）</li>
                                                </ul>
                                            </td>

                                            <td width="10%" class="center" :rowspan="row.orderItemList.length"
                                                v-if="row.order.orderStatus=='0'&&index==0">
                                                <ul class="unstyled">
                                                    <li>等待买家付款</li>
                                                    <li><a href="orderDetail.html" class="btn">订单详情 </a></li>
                                                </ul>
                                            </td>

                                            <td width="10%" class="center" :rowspan="row.orderItemList.length"
                                                v-if="row.order.orderStatus=='1'&&index==0">
                                                <ul class="unstyled">
                                                    <li>买家已付款</li>
                                                    <li><a href="orderDetail.html" class="btn">订单详情 </a></li>
                                                </ul>
                                            </td>

                                            <td width="10%" class="center" :rowspan="row.orderItemList.length"
                                                v-if="row.order.orderStatus=='2'&&index==0">
                                                <ul class="unstyled">
                                                    <li>已发货</li>
                                                    <li><a href="orderDetail.html" class="btn">订单详情 </a></li>
                                                </ul>
                                            </td>

                                            <td width="10%" class="center" :rowspan="row.orderItemList.length"
                                                v-if="row.order.orderStatus=='3'&&index==0">
                                                <ul class="unstyled">
                                                    <li>订单完成</li>
                                                    <li><a href="orderDetail.html" class="btn">订单详情 </a></li>
                                                </ul>
                                            </td>
                                            <td width="10%" class="center" :rowspan="row.orderItemList.length"
                                                v-if="row.order.orderStatus=='4'&&index==0">
                                                <ul class="unstyled">
                                                    <li>订单已关闭</li>
                                                    <li><a href="orderDetail.html" class="btn">订单详情 </a></li>
                                                </ul>
                                            </td>
                                            <td width="10%" class="center" :rowspan="row.orderItemList.length"
                                                v-if="row.order.orderStatus=='0'&&index==0">
                                                <ul class="unstyled">
                                                    <li><a :href="'/weixinpay.html?orderId'+row.order.id"
                                                           class="sui-btn btn-info">立即付款</a></li>
                                                    <li><a @onclick="cancelOrder(row.order.id)">取消订单</a></li>
                                                </ul>
                                            </td>

                                            <td width="10%" class="center" :rowspan="row.orderItemList.length"
                                                v-if="row.order.orderStatus=='1'&&index==0">
                                                <ul class="unstyled">
                                                    <li><a href="#" class="sui-btn btn-info">提醒发货</a></li>
                                                </ul>
                                            </td>
                                            <td width="10%" class="center" :rowspan="row.orderItemList.length"
                                                v-if="row.order.orderStatus=='2'&&index==0">
                                                <ul class="unstyled">
                                                    <li><a href="#" class="sui-btn btn-info">确认收货</a></li>
                                                </ul>
                                            </td>
                                            <td width="10%" class="center" v-if="row.order.orderStatus=='3'">
                                                <ul class="unstyled">
                                                    <li>
                                                        <a @click="formVisible=true;pojo={orderItemId : orderItem.id }"
                                                           class="sui-btn btn-info"
                                                           v-if="row.order.buyerRate=='0'">评价</a>
                                                        <a @click="formVisible2=true;pojo={orderItemId : orderItem.id }"
                                                           class="sui-btn btn-info"
                                                           v-if="row.order.buyerRate=='1'">追评</a>
                                                    </li>
                                                </ul>
                                            </td>
                                            <td width="10%" class="center" :rowspan="row.orderItemList.length"
                                                v-if="row.order.orderStatus=='4'&&index==0">
                                                <ul class="unstyled">
                                                    <li><a href="#" class="sui-btn btn-info">订单已关闭</a></li>
                                                </ul>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>

                                </div>

                            </div>
                            <div class="choose-order">
                                <!-- <div class="sui-pagination pagination-large top-pages">
                                     <ul>
                                         <li class="prev disabled"><a href="#">«上一页</a></li>
                                         <li class="active"><a href="#">1</a></li>
                                         <li><a href="#">2</a></li>
                                         <li><a href="#">3</a></li>
                                         <li class="dotted"><span>...</span></li>
                                         <li class="next"><a href="#">下一页»</a></li>
                                     </ul>
                                     <div><span>共{{}}页</span><span>
                                             到
                                             <input type="text" class="page-num"><button class="page-confirm"
                                                                                         onclick="alert(1)">确定</button>
                                             页</span></div>
                                 </div>-->
                                <div class="pagination-container">
                                    <el-pagination
                                            class="pagiantion"
                                            @size-change="findAll"
                                            @current-change="findAll"
                                            :page-sizes="[10, 20, 30, 40]"
                                            :page-size="size"
                                            :current-page.sync="currentPage"
                                            layout="total, prev, pager, next, jumper"
                                            :total="total">
                                    </el-pagination>
                                </div>
                            </div>

                            <div class="clearfix"></div>
                        </div>

                        <div class="like-title">
                            <div class="mt">
                                <span class="fl"><strong>热卖单品</strong></span>
                            </div>
                        </div>
                        <div class="like-list">
                            <ul class="yui3-g">
                                <li class="yui3-u-1-4">
                                    <div class="list-wrap">
                                        <div class="p-img">
                                            <img src="./img/_/itemlike01.png"/>
                                        </div>
                                        <div class="attr">
                                            <em>DELL戴尔Ins 15MR-7528SS 15英寸 银色 笔记本</em>
                                        </div>
                                        <div class="price">
                                            <strong>
                                                <em>¥</em>
                                                <i>3699.00</i>
                                            </strong>
                                        </div>
                                        <div class="commit">
                                            <i class="command">已有6人评价</i>
                                        </div>
                                    </div>
                                </li>
                                <li class="yui3-u-1-4">
                                    <div class="list-wrap">
                                        <div class="p-img">
                                            <img src="./img/_/itemlike02.png"/>
                                        </div>
                                        <div class="attr">
                                            <em>Apple苹果iPhone 6s/6s Plus 16G 64G 128G</em>
                                        </div>
                                        <div class="price">
                                            <strong>
                                                <em>¥</em>
                                                <i>4388.00</i>
                                            </strong>
                                        </div>
                                        <div class="commit">
                                            <i class="command">已有700人评价</i>
                                        </div>
                                    </div>
                                </li>
                                <li class="yui3-u-1-4">
                                    <div class="list-wrap">
                                        <div class="p-img">
                                            <img src="./img/_/itemlike03.png"/>
                                        </div>
                                        <div class="attr">
                                            <em>DELL戴尔Ins 15MR-7528SS 15英寸 银色 笔记本</em>
                                        </div>
                                        <div class="price">
                                            <strong>
                                                <em>¥</em>
                                                <i>4088.00</i>
                                            </strong>
                                        </div>
                                        <div class="commit">
                                            <i class="command">已有700人评价</i>
                                        </div>
                                    </div>
                                </li>
                                <li class="yui3-u-1-4">
                                    <div class="list-wrap">
                                        <div class="p-img">
                                            <img src="./img/_/itemlike04.png"/>
                                        </div>
                                        <div class="attr">
                                            <em>DELL戴尔Ins 15MR-7528SS 15英寸 银色 笔记本</em>
                                        </div>
                                        <div class="price">
                                            <strong>
                                                <em>¥</em>
                                                <i>4088.00</i>
                                            </strong>
                                        </div>
                                        <div class="commit">
                                            <i class="command">已有700人评价</i>
                                        </div>
                                    </div>
                                </li>

                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- 底部栏位 -->
    <!--页面底部-->
    <div class="clearfix footer">
        <div class="py-container">
            <div class="footlink">
                <div class="Mod-service">
                    <ul class="Mod-Service-list">
                        <li class="grid-service-item intro  intro1">

                            <i class="serivce-item fl"></i>
                            <div class="service-text">
                                <h4>正品保障</h4>
                                <p>正品保障，提供发票</p>
                            </div>

                        </li>
                        <li class="grid-service-item  intro intro2">

                            <i class="serivce-item fl"></i>
                            <div class="service-text">
                                <h4>正品保障</h4>
                                <p>正品保障，提供发票</p>
                            </div>

                        </li>
                        <li class="grid-service-item intro  intro3">

                            <i class="serivce-item fl"></i>
                            <div class="service-text">
                                <h4>正品保障</h4>
                                <p>正品保障，提供发票</p>
                            </div>

                        </li>
                        <li class="grid-service-item  intro intro4">

                            <i class="serivce-item fl"></i>
                            <div class="service-text">
                                <h4>正品保障</h4>
                                <p>正品保障，提供发票</p>
                            </div>

                        </li>
                        <li class="grid-service-item intro intro5">

                            <i class="serivce-item fl"></i>
                            <div class="service-text">
                                <h4>正品保障</h4>
                                <p>正品保障，提供发票</p>
                            </div>

                        </li>
                    </ul>
                </div>
                <div class="clearfix Mod-list">
                    <div class="yui3-g">
                        <div class="yui3-u-1-6">
                            <h4>购物指南</h4>
                            <ul class="unstyled">
                                <li>购物流程</li>
                                <li>会员介绍</li>
                                <li>生活旅行/团购</li>
                                <li>常见问题</li>
                                <li>购物指南</li>
                            </ul>

                        </div>
                        <div class="yui3-u-1-6">
                            <h4>配送方式</h4>
                            <ul class="unstyled">
                                <li>上门自提</li>
                                <li>211限时达</li>
                                <li>配送服务查询</li>
                                <li>配送费收取标准</li>
                                <li>海外配送</li>
                            </ul>
                        </div>
                        <div class="yui3-u-1-6">
                            <h4>支付方式</h4>
                            <ul class="unstyled">
                                <li>货到付款</li>
                                <li>在线支付</li>
                                <li>分期付款</li>
                                <li>邮局汇款</li>
                                <li>公司转账</li>
                            </ul>
                        </div>
                        <div class="yui3-u-1-6">
                            <h4>售后服务</h4>
                            <ul class="unstyled">
                                <li>售后政策</li>
                                <li>价格保护</li>
                                <li>退款说明</li>
                                <li>返修/退换货</li>
                                <li>取消订单</li>
                            </ul>
                        </div>
                        <div class="yui3-u-1-6">
                            <h4>特色服务</h4>
                            <ul class="unstyled">
                                <li>夺宝岛</li>
                                <li>DIY装机</li>
                                <li>延保服务</li>
                                <li>品优购E卡</li>
                                <li>品优购通信</li>
                            </ul>
                        </div>
                        <div class="yui3-u-1-6">
                            <h4>帮助中心</h4>
                            <img src="./img/wx_cz.jpg">
                        </div>
                    </div>
                </div>
                <div class="Mod-copyright">
                    <ul class="helpLink">
                        <li>关于我们<span class="space"></span></li>
                        <li>联系我们<span class="space"></span></li>
                        <li>关于我们<span class="space"></span></li>
                        <li>商家入驻<span class="space"></span></li>
                        <li>营销中心<span class="space"></span></li>
                        <li>友情链接<span class="space"></span></li>
                        <li>关于我们<span class="space"></span></li>
                        <li>营销中心<span class="space"></span></li>
                        <li>友情链接<span class="space"></span></li>
                        <li>关于我们</li>
                    </ul>
                    <p>地址：北京市昌平区建材城西路金燕龙办公楼一层 邮编：100096 电话：400-618-4000 传真：010-82935100</p>
                    <p>京ICP备08001421号京公网安备110108007702</p>
                </div>
            </div>
        </div>
    </div>
    <div class="add-form">
        <!--弹出窗口-->
        <el-dialog title="评价" :visible.sync="formVisible">
            <el-form label-width="80px">
                <el-form-item label="评级">
                    <el-radio-group v-model="pojo.userEvaluation">
                        <el-radio :label="1">一星</el-radio>
                        <el-radio :label="2">二星</el-radio>
                        <el-radio :label="3">仨星</el-radio>
                        <el-radio :label="4">四星</el-radio>
                        <el-radio :label="5">五星</el-radio>
                    </el-radio-group>

                </el-form-item>
                <el-form-item label="评论内容">
                    <el-input v-model="pojo.commentContent" type="textarea"
                              :autosize="{ minRows: 2, maxRows: 4}"></el-input>

                </el-form-item>
                <el-form-item label="是否匿名">

                    <el-switch
                            v-model="pojo.isHide"
                            active-color="#13ce66"
                            inactive-color="#ff4949"
                            active-value="1"
                            inactive-value="0"
                            active-text="匿名"
                            inactive-text="不匿名">
                    </el-switch>
                    </el-tooltip>
                </el-form-item>

                <el-form-item label="图片">
                    <el-upload
                            class="avatar-uploader"
                            action="/upload/native.do"
                            :show-file-list="false"
                            :on-success="handleAvatarSuccess"
                            :before-upload="beforeAvatarUpload">
                        <img v-if="imageUrl" :src="imageUrl" class="avatar">
                        <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                    </el-upload>
                </el-form-item>


                <el-form-item>
                    <el-button type="primary" @click="userComment()">保存</el-button>
                    <el-button @click="pojo={},formVisible = false">关闭</el-button>
                </el-form-item>
            </el-form>
        </el-dialog>
    </div>
    <!--弹出窗口-->
    <el-dialog title="追评" :visible.sync="formVisible2">
        <el-form label-width="80px">

            <el-form-item label="追评内容">
                <el-input v-model="pojo.commentContent" type="textarea"
                          :autosize="{ minRows: 2, maxRows: 4}"></el-input>
            </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="userComment2()">保存</el-button>
                    <el-button @click="pojo={},formVisible2 = false">关闭</el-button>
                </el-form-item>
        </el-form>
    </el-dialog>
</div>
<!--页面底部END-->
</div>


</body>
<script src="js/vue.js"></script>
<script src="js/axios.js"></script>
<script src="js/elementui.js"></script>
<script>
    new Vue({
        el: "#app",
        data() {
            return {
                rows: [],
                username: '',
                currentPage: 1,
                size: 5,
                total: '',
                pojo: {},
                formVisible: false,
                formVisible2: false,
                imageUrl: '',
            }
        },
        created() {
            axios.get(`/login/username.do`).then(response => {
                this.username = response.data.username;
            });
            this.findAll()
        },
        methods: {
            findAll() {
                axios.get(`/order/findOrderPage.do?page=${this.currentPage}&size=${this.size}`).then(response => {
                    this.rows = response.data.rows;
                    this.total = response.data.total;
                    this.rows[0].order.buyerRate = '1';
                    // alert(JSON.stringify(this.rows[0].order.id))
                })
            },
            cancelOrder(orderId) {
                if (console("确定要删除" + orderId)) {
                    alert("成功删除")
                }
            },
            userComment() {
                this.pojo.images = this.imageUrl; //如页面有图片上传功能放开注释
                axios.post(`/comment/add.do`, this.pojo).then(response => {
                    if (response.data.code == 0) {
                        alert("评价成功！");
                        this.formVisible = false;//关闭窗口
                        this.pojo = {}
                    } else {
                        alert("评价失败！")
                    }
                });
                //alert(JSON.stringify(this.pojo))
            }, userComment2() {
                this.pojo.images = this.imageUrl; //如页面有图片上传功能放开注释
                axios.post(`/comment/update.do`, this.pojo).then(response => {
                    if (response.data.code == 0) {
                        alert("追评成功！");
                        this.formVisible2 = false;//关闭窗口
                        this.pojo = {}
                    } else {
                        alert("追评失败！")
                    }
                });
            },
            handleAvatarSuccess(res, file) {
                this.imageUrl = file.response;
            },
            beforeAvatarUpload(file) {
                const isJPG = file.type === 'image/jpeg';
                const isLt2M = file.size / 1024 / 1024 < 2;

                if (!isJPG) {
                    this.$message.error('上传头像图片只能是 JPG 格式!');
                }
                if (!isLt2M) {
                    this.$message.error('上传头像图片大小不能超过 2MB!');
                }
                return isJPG && isLt2M;
            }
        }
    })
</script>
</html>